/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Date;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;

/**
 *
 * @author Nguyen Cong Dat
 */
@Entity
public class RedemptionListEntity implements Serializable {
    private static long serialVersionUID = 1L;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public static void setSerialVersionUID(long aSerialVersionUID) {
        serialVersionUID = aSerialVersionUID;
    }
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private String name;
    private String description;
    private Integer maxQuantity;
    private Double pointsToRedeem;
    private Integer validPeriod;
    private Double costOfItem;
    private String status;
    private String imageURL;
    private Boolean visibility = true;
    private String highlight;
    private String fineprint;
    private String remarkFromStakeholder;
    private String remarkFromTCube;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date validFrom;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dateCreated;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date validUntil;
    @OneToMany(mappedBy="redemptionList")
    private List<RedemptionItemEntity> redemptionItems= new ArrayList<RedemptionItemEntity>();
    @ManyToOne
    private StakeholderEntity stakeholder;

    public RedemptionListEntity() {        
    }
    
    public RedemptionListEntity(RedemptionListEntity list) {
       this.name = list.getName();
       this.description = list.getDescription();
       this.maxQuantity = list.getMaxQuantity();
       this.costOfItem = list.getCostOfItem();
       this.validFrom = list.getValidFrom();
       this.validUntil = list.getValidUntil();
       this.dateCreated = new Date();  
       this.visibility = list.getVisibility();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getMaxQuantity() {
        return maxQuantity;
    }

    public void setMaxQuantity(Integer maxQuantity) {
        this.maxQuantity = maxQuantity;
    }

    public Double getPointsToRedeem() {
        return pointsToRedeem;
    }

    public void setPointsToRedeem(Double pointsToRedeem) {
        this.pointsToRedeem = pointsToRedeem;
    }

    public Integer getValidPeriod() {
        return validPeriod;
    }

    public void setValidPeriod(Integer validPeriod) {
        this.validPeriod = validPeriod;
    }

    public Double getCostOfItem() {
        return costOfItem;
    }

    public void setCostOfItem(Double costOfItem) {
        this.costOfItem = costOfItem;
    }

    public Boolean getVisibility() {
        return visibility;
    }

    public void setVisibility(Boolean visibility) {
        this.visibility = visibility;
    }

    public String getHighlight() {
        return highlight;
    }

    public void setHighlight(String highlight) {
        this.highlight = highlight;
    }

    public String getFineprint() {
        return fineprint;
    }

    public void setFineprint(String fineprint) {
        this.fineprint = fineprint;
    }

    public Date getValidFrom() {
        return validFrom;
    }

    public void setValidFrom(Date validFrom) {
        this.validFrom = validFrom;
    }

    public Date getDateCreated() {
        return dateCreated;
    }

    public void setDateCreated(Date dateCreated) {
        this.dateCreated = dateCreated;
    }

    public Date getValidUntil() {
        return validUntil;
    }

    public void setValidUntil(Date validUntil) {
        this.validUntil = validUntil;
    }

    public List<RedemptionItemEntity> getRedemptionItems() {
        return redemptionItems;
    }

    public void setRedemptionItems(List<RedemptionItemEntity> redemptionItems) {
        this.redemptionItems = redemptionItems;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public StakeholderEntity getStakeholder() {
        return stakeholder;
    }

    public void setStakeholder(StakeholderEntity stakeholder) {
        this.stakeholder = stakeholder;
    }

    public String getImageURL() {
        return imageURL;
    }

    public void setImageURL(String imageURL) {
        this.imageURL = imageURL;
    }

    public String getRemarkFromStakeholder() {
        return remarkFromStakeholder;
    }

    public void setRemarkFromStakeholder(String remarkFromStakeholder) {
        this.remarkFromStakeholder = remarkFromStakeholder;
    }

    public String getRemarkFromTCube() {
        return remarkFromTCube;
    }

    public void setRemarkFromTCube(String remarkFromTCube) {
        this.remarkFromTCube = remarkFromTCube;
    }  
}
